<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<center>
    <table>
        <tr>
            <td>编号：</td>
            <td><input type="text" id="num"></td>
        </tr>
        <tr>
            <td>客户名称：</td>
            <td><input type="text" id="name"></td>
        </tr>
        <tr>
            <td>负责人：</td>
            <td><input type="text" id="people"></td>
        </tr>
        <tr>
            <td>公司电话：</td>
            <td><input type="text" id="tel"></td>
        </tr>
        <tr>
            <td>描述：</td>
            <td><input type="text" id="content"></td>
        </tr>
        <tr>
            <td><input type="button" value="添加" id="submit"></td>
            <td></td>
        </tr>
    </table>
</center>
</body>
</html>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script>
    $(document).on("click","#submit",function(){
        var num = $("#num").val();
        var name = $("#name").val();
        var people = $("#people").val();
        var tel = $("#tel").val();
        var content = $("#content").val();

        $.ajax({
            url:"add.php",
            data:{num:num,name:name,people:people,tel:tel,content:content},
            dataType:"json",
            type:"POST",

            success:function(e){
                if(e == 1){
                    alert("添加成功");
                    location.href = "list.php";

                }else{
                    alert("添加失败");
                    location.href = "add.html";
                }
            }
        })
    })
</script>